<template>
  <div class="wrapper" :class="{ hiddenAside: !asideIsShow }">
    <header>
      <Breadcrumb @hidden="asideIsShow = !asideIsShow"></Breadcrumb>
    </header>
    <aside><AsideNavBar></AsideNavBar></aside>
    <main>
      <router-view />
    </main>
  </div>
</template>

<script>
import AsideNavBar from "@/components/AsideNavBar.vue";
import Breadcrumb from "@/components/Breadcrumb.vue";
import { ref } from "vue";
export default {
  components: {
    AsideNavBar,
    Breadcrumb,
  },
  setup() {
    const asideIsShow = ref(true);
    return {
      asideIsShow,
    };
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  header {
    position: fixed;
    top: 0;
    left: 261px;
    z-index: 10;
    background: var(--head-bg);
    width: calc(100% - 261px);
    height: 46px;
    box-shadow: 0 0 2px gray;
    display: flex;
    align-items: center;
    transition: 0.7s;
    min-width: 300px;
  }
  aside {
    position: fixed;
    z-index: 2;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    box-shadow: 0 0 5px gray;
    backdrop-filter: blur(20px);
    transition: 0.7s;
  }
  main {
    overflow: auto;
    width: 100%;
    height: 100%;
    padding: 46px 0 20px 260px;
    transition: 0.7s;
  }
}
.hiddenAside {
  header {
    left: 0;
    width: 100%;
  }
  aside {
    left: -260px;
  }
  main {
    padding-left: 0;
  }
}
@media screen and (max-width: 620px) {
  .wrapper {
    main {
      padding-left: 0;
    }
  }
}
</style>